<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2021/9/22
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>手机列表</title>
</head>
<body>
    <h1>欢迎${user.username}登录手机管理系统</h1>
    <a href="/addPhone.jsp">添加手机</a>
    <table border="1px" width="400px">
        <tr>
            <th>编号</th><th>库存</th><th>名称</th><th>型号</th><th>价格</th><th>出厂日期</th><th>操作</th>
        </tr>
        <c:forEach var="phone" items="${phones}">
            <tr>
                <td>${phone.id}</td>
                <td>${phone.inventory}</td>
                <td>${phone.name}</td>
                <td>${phone.type}</td>
                <td>${phone.price}</td>
                <td>${phone.date}</td>
                <td>
                    <a href="/findPhone.do?id=${phone.id}">更新</a> &nbsp;
                    <a href="javascript:if(confirm('是否确定删除?'))location.href='/removePhone.do?id=${phone.id}'">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</body>
</html>
